import request from '@/utils/request';

// 获取部门管理分页列表
export const getDepManagePageList = (data) => {
  return request({
    url: '/personnelManagement/departments/getAllDepartments',
    method: 'POST',
    data,
  });
};

// 获取部门列表
export const getDepList = () => {
  return request({
    url: '/personnelManagement/departments/getDepartmentRelationshipMap',
    method: 'POST',
  });
};

// 新增部门
export const addDepReq = (data) => {
  return request({
    url: '/personnelManagement/departments/addNewDepartment',
    method: 'POST',
    data,
  });
};

// 编辑部门

export const editDepReq = (data) => {
  return request({
    url: '/personnelManagement/departments/updateDepartment',
    method: 'POST',
    data,
  });
};

// 删除部门
export const deleteDep = (data) => {
  return request({
    url: '/personnelManagement/departments/delete',
    method: 'POST',
    data,
  });
};

// 获取所有负责人
export const getAllEmployeeReq = () => {
  return request({
    url: '/personnelManagement/departments/getDepartmentHead',
    method: 'POST',
  });
};

// 根据部门id获取岗位分页列表
export const getPositionById = (data) => {
  return request({
    url: '/personnelManagement/departments/obtainJobPositionsByDepartmentId',
    method: 'POST',
    data,
  });
};
